package com.qumitech.visualnovel.pubdef.dto.chat;

import java.util.*;
import com.alibaba.fastjson.annotation.JSONField;

public class ChatMsgQueryDTO {
    @JSONField(name="id")
    private Long id;

    @JSONField(name="category")
    private String category;

    @JSONField(name="from_uid")
    private String fromId;

    @JSONField(name="to_uid")
    private Long toId;

    @JSONField(name="msg_type")
    private String msgType;

    @JSONField(name="msg_content")
    private String msgContent;

    @JSONField(name="image_url")
    private String imageUrl;

    @JSONField(name="voice_url")
    private String voiceUrl;

    @JSONField(name="video_url")
    private String videoUrl;

    @JSONField(name="thumb_url")
    private String thumbUrl;

    @JSONField(name="read_status")
    private Byte readStatus;

    @JSONField(name="limit_type")
    private Byte limitType;

    @JSONField(name="create_time")
    private Date createTime;

    @JSONField(name="from_uid_name")
    private String fromIdName;

    @JSONField(name="to_uid_name")
    private String toIdName;

    @JSONField(name="from_account_forbidden_state")
    private Byte fromIdForbiddenState;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category == null ? null : category.trim();
    }

    public String getFromId() {
        return fromId;
    }

    public void setFromId(String fromId) {
        this.fromId = fromId == null ? null : fromId.trim();
    }

    public Long getToId() {
        return toId;
    }

    public void setToId(Long toId) {
        this.toId = toId;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType == null ? null : msgType.trim();
    }

    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent == null ? null : msgContent.trim();
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl == null ? null : imageUrl.trim();
    }

    public String getVoiceUrl() {
        return voiceUrl;
    }

    public void setVoiceUrl(String voiceUrl) {
        this.voiceUrl = voiceUrl == null ? null : voiceUrl.trim();
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl == null ? null : videoUrl.trim();
    }

    public String getThumbUrl() {
        return thumbUrl;
    }

    public void setThumbUrl(String thumbUrl) {
        this.thumbUrl = thumbUrl == null ? null : thumbUrl.trim();
    }

    public Byte getReadStatus() {
        return readStatus;
    }

    public void setReadStatus(Byte readStatus) {
        this.readStatus = readStatus;
    }

    public Byte getLimitType() {
        return limitType;
    }

    public void setLimitType(Byte limitType) {
        this.limitType = limitType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getFromIdName() {
        return fromIdName;
    }

    public void setFromIdName(String fromIdName) {
        this.fromIdName = fromIdName;
    }

    public String getToIdName() {
        return toIdName;
    }

    public void setToIdName(String toIdName) {
        this.toIdName = toIdName;
    }

    public Byte getFromIdForbiddenState() {
        return fromIdForbiddenState;
    }

    public void setFromIdForbiddenState(Byte fromIdForbiddenState) {
        this.fromIdForbiddenState = fromIdForbiddenState;
    }

    public void setFromIdName(Map<Long, String> nicknameMap) {
        Long fromUid = Long.valueOf(this.fromId);
        if (nicknameMap.containsKey(fromUid)) {
            this.fromIdName = nicknameMap.get(fromUid);
        }
    }

    public void setToIdName(Map<Long, String> nicknameMap) {
        if (nicknameMap.containsKey(this.toId)) {
            this.toIdName = nicknameMap.get(this.toId);
        }
    }

    public void setForbidden(Map<Long, Boolean> forbiddenMap) {
        Long fromUid = Long.valueOf(this.fromId);
        if (forbiddenMap.containsKey(fromUid)) {
            this.fromIdForbiddenState = 1;
        } else {
            this.fromIdForbiddenState = 2;
        }
    }
}
